/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 10 - 15
 * Time: 10:46
 */
//牛客 最近公共祖先（将一棵无穷大满二叉树的结点……）
public class Solution9 {
    public int getLCA(int a, int b) {
        while(a != b) {
            if(a > b) {
                a /= 2;
            }else if(a < b) {
                b /= 2;
            }
        }
        return a;
    }
}
